<template>
  <div style="position: relative;">
    <header_y></header_y>
    <sidebar></sidebar>
    <div style="position: absolute;top: 120px;left: 300px">
      <p>
        职务名称：<input type="text" placeholder="请输入职务名称" class="a1">&emsp;&emsp;
        职务编码：<input type="text" placeholder="请输入职务编码" class="a1">
        <button class="a3">查询</button>
        <button class="a2">重置</button>
      </p>
      <p>
        <button class="a3" @click="go_add">+ 新增</button>
        <button class="a2">删除</button>
        <button class="a2">导出</button>
        <button class="a2">导入</button>
      </p>
      <div>
        <table border="1" cellspacing="0">
          <tr align="center" height="40px">
            <td width="50px">
              <input type="checkbox">
            </td>
            <td width="150px">账号</td>
            <td width="100px">姓名</td>
            <td width="50px">性别</td>
            <td width="150px">手机号</td>
            <td width="150px">邮箱</td>
            <td width="150px">工号</td>
            <td width="50px">状态</td>
            <td width="150px">操作</td>
          </tr>
          <tr v-for="i in list" :key="i.id" align="center" height="40px">
            <td>
              <input type="checkbox">
            </td>
            <td>{{i.account_number}}</td>
            <td>{{i.name}}</td>
            <td>{{i.sex}}</td>
            <td>{{i.mobile}}</td>
            <td>{{i.mailbox}}</td>
            <td>{{i.job_number}}</td>
            <td></td>
            <td>编辑&emsp;更多</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
import header_y from "@/components/p9/comm/header_y";
import sidebar from "@/components/p9/comm/sidebar";
import maxios from "@/http/axios";

export default {
  name: "users",
  components:{
    'header_y':header_y,
    'sidebar':sidebar
  },
  data(){
    return{
      list:[]
    }
  },
  methods:{
    get_user(){
      maxios('/user/add','get').then(res=>{
        if(res.code==200){
          this.list = res.matter
          // console.log(res.matter)
        }
      })
    },
    go_add(){
      this.$router.push('/add_user')
    }
  },
  mounted() {
    this.get_user()
  }
}
</script>

<style scoped>
.a1{
  height: 30px;
  margin-right: 20px;
}
.a2{
  height: 36px;
  border: none;
  margin-left: 20px;
  width: 100px;
}
.a3{
  height: 36px;
  width: 100px;
  border: none;
  background-color: #2f54eb;
  color: white;
}
</style>